

package com.hazelcast.internal.config;

import com.hazelcast.config.WanReplicationRef;

import javax.annotation.Nonnull;
import java.util.List;

/**
 * Configuration for Wan target replication reference(read only)
 */
public class WanReplicationRefReadOnly extends WanReplicationRef {

    public WanReplicationRefReadOnly(WanReplicationRef ref) {
        super(ref);
    }

    @Override
    public WanReplicationRef setName(@Nonnull String name) {
        throw throwReadOnly();
    }

    @Override
    public WanReplicationRef setMergePolicyClassName(@Nonnull String mergePolicyClassName) {
        throw throwReadOnly();
    }

    @Override
    public WanReplicationRef setFilters(@Nonnull List<String> filters) {
        throw throwReadOnly();
    }

    @Override
    public WanReplicationRef addFilter(@Nonnull String filterClassName) {
        throw throwReadOnly();
    }

    @Override
    public WanReplicationRef setRepublishingEnabled(boolean republishingEnabled) {
        throw throwReadOnly();
    }

    private UnsupportedOperationException throwReadOnly() {
        throw new UnsupportedOperationException("This config is read-only");
    }
}
